Add parameters

You can employ parameters which can be requested each time the report is being previewed. And, depending on the values you use, the report can then be filtered. It's also possible to employ parameters in expressions of calculated fields. In this example, we'll create two date-time parameters to filter out orders which don't fall within a required range:

  1. In the Field List window, right-click on the Parameters section and in the menu, click Add Parameter. Repeat this action to create the second parameter.
  2. Adding a parameter

  3. In the Field List, select the first parameter, and in the Property Grid, set its (Name) and Description. And make sure to set its Type to an appropriate value. Then, repeat this step for the second parameter.

    Setting up parameter's settings

    Now, every time your report is previewed, you will be asked to specify two dates.

    Note: In Print Preview, if a report's Request Parameters option is set to Yes, its document is not generated until you have submitted values of all visible parameters via the Parameters UI.

  4. To use the new parameters to filter the report's data: click the report's Smart Tag, and in the actions list, click on the ellipsis button for the Filter String entry. Then, in the displayed Filter String Editor, construct an expression where a data field is compared with the created parameters. To access parameters, click the icon on the right until it turns into a question mark.

    Opening the Filter String Editor

    The complete filtering expression will then look like this.

    Filter String Editor

The parametrized report is now ready. Switch to the Preview tab, and in the Parameters section, enter the required values and click Submit.